import type { VabRouteRecord } from '/#/router'
import Layout from '@vab/layouts/index.vue'

export const brandRouter: VabRouteRecord = {
  path: '/brand',
  name: 'brand',
  component: Layout,
  meta: {
    title: '品牌授权',
    icon: 'currency-line',
    guard: {
      //2021年9月份新版本，当config/settings.js中rolesControl配置开启时，用于控制角色（全写）
      role: ['brandAudit', 'brandApplyForAdmin','brandApplyForAdminAdd'],
      mode: 'oneOf', //allOf: 数组内所有角色都拥有，返回True oneOf: 数组内拥有任一角色，返回True(等价第1种数据) except: 不拥有数组内任一角色，返回True(取反)
    },
  },
  children: [
    {
      path: 'brandAudit',
      name: 'brandAudit',
      component: () => import('@/views/brand/brandAudit.vue'),
      meta: {
        title: '区域申请',
        guard: {
          role: ['brandAudit'],
        },
      },
    },
    {
      path: 'brandApplyForAdmin',
      name: 'brandApplyForAdmin',
      component: () => import('@/views/brand/brandApplyForAdmin.vue'),
      meta: {
        title: '品牌申请',
        guard: {
          role: ['brandApplyForAdmin'],
        },
      },
    },
    {
      path: 'brandApplyForAdminAdd',
      name: 'brandApplyForAdminAdd',
      component: () => import('~/src/views/brand/brandApplyForAdminAdd.vue'),
      meta: {
        title: '品牌申请信息',
        hidden: true,
        tabHidden: true,
        guard: {
          role: ['brandApplyForAdminAdd'],
        },
      },
    },
  ],
}
